package com.carlosk.kandicar.domain.ui;

import com.carlosk.kandicar.domain.BaseDomain;
import com.carlosk.kandicar.util.ValueUtil;

/**
 * 选择联系人结果的数据模型
 * 
 * @author carlos carlosk@163.com
 * @version 创建时间：2014年5月19日 下午7:44:23
 */

public class ChooseContactResultRowDomain extends BaseDomain {

	private String id;
	private String title;
	private int type;// 类型,0是人,1是组织
	private boolean isSeleted;// 是否选中

	public boolean isSeleted() {
		return isSeleted;
	}

	public void setSeleted(boolean isSeleted) {
		this.isSeleted = isSeleted;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getTitle() {
		return title;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public int getType() {
		return type;
	}

	public void setType(int type) {
		this.type = type;
	}

	@Override
	public int hashCode() {
		if (ValueUtil.isStrNotEmpty(id)) {
			return id.hashCode();
		}
		return super.hashCode();
	}

	@Override
	public boolean equals(Object o) {
		ChooseContactResultRowDomain domain = (ChooseContactResultRowDomain) o;
		if (ValueUtil.isStrNotEmpty(id)) {
			return id.equals(domain.getId());
		}
		return super.equals(o);
	}
}
